import api from '../../api/index';
import { sdk } from '../../config/sdk';
Page({
  data: {
    loading: true,
    animation: true
  },
  onLoad(options) {
    this.getExan();
  },

  async getExan() {
    const self = this;
    const { year, term } = sdk.isDate.getDate();
    const { code, message, data } = await sdk.request({ url: api.getExam, data: { year, term } });
    if (code != 1000) return this.$error(message);
    this.setData({
      exan: data,
      loading: true
    });
    const timer = setTimeout(function () {
      self.setData({
        animation: false
      });
      clearTimeout(timer);
    }, 1000);
  },

})